package com.augurit.gzcgwsp.qyzz.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import jxl.write.WritableSheet;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.orm.Page;

import com.augurit.gzcgwsp.qyzz.dao.YwRqQyzzFinalAzWxRyZsDao;
import com.augurit.gzcgwsp.qyzz.entity.YwRqQyzzAzWxRyZs;
import com.augurit.gzcgwsp.qyzz.entity.YwRqQyzzFinalAzWxRyZs;
import com.augurit.gzcgwsp.qyzz.entity.YwRqQyzzFinalJsRy;
import com.augurit.gzcgwsp.qyzz.entity.YwRqQyzzJsRy;
import com.augurit.gzcgwsp.qyzz.service.IYwRqQyzzFinalAzWxRyZsService;

/**
 * 
 *  企业资质--燃气燃烧器具安装维修人员持证情况service实现类
 * @author 张军
 *
 */
@Service
@Transactional
public class YwRqQyzzFinalAzWxRyZsServiceImpl  implements IYwRqQyzzFinalAzWxRyZsService {
	private final static Log log=LogFactory.getLog(YwRqQyzzFinalAzWxRyZsServiceImpl.class);
	 @Autowired
	private YwRqQyzzFinalAzWxRyZsDao ywRqQyzzFinalAzWxRyZsDao;
    public void saveEntity(YwRqQyzzFinalAzWxRyZs entity) {
        ywRqQyzzFinalAzWxRyZsDao.save(entity);
        
    }
    public List<YwRqQyzzFinalAzWxRyZs> getAZWxRyZs(long qyid, String acceptno) {
        return ywRqQyzzFinalAzWxRyZsDao.getAZWxRyZs(qyid, acceptno);
    }
    public void delete(YwRqQyzzFinalAzWxRyZs entity) {
        ywRqQyzzFinalAzWxRyZsDao.delete(entity);
        
    }
   
	/*
	 * (non-Javadoc)
	 * @see com.augurit.gzcgwsp.qyzz.service.IYwRqQyzzJsRyService#getPage(java.lang.String, org.springside.modules.orm.Page, java.lang.Long, java.lang.String)
	 */
	public Page getPage(String acceptNo, Page page,
			Long qyid, String type) {
		String hql=" from "+YwRqQyzzAzWxRyZs.class.getName()+" where acceptNo='"+acceptNo+"'";
		if("2".equals(type)){
			hql=" from "+YwRqQyzzFinalAzWxRyZs.class.getName()+" where qyid='"+qyid+"'";
		}
		Map<String,String> values=new HashMap<String,String>();
		page=ywRqQyzzFinalAzWxRyZsDao.findPage(page, hql, values);
		return page;
	}


	
	 
}
